package com.cnap.multiclouldmgmt.model.exception;


import com.cnap.multiclouldmgmt.model.ResultCode;

/**
 * <类文件描述>
 *
 * @author xc
 **/
public class JsonException extends RuntimeException {

    private final int code;
    private final String message;

    public JsonException(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public JsonException(ResultCode resultCode) {
        this.code = (int) resultCode.getCode();
        this.message = resultCode.getMessage();
    }

    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
